<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php include(APPLICATION_BASE_TPL_PATH . "/inc/include.phtml"); ?>
    <title>系统通知管理</title>
</head>

<body>

<div id="wrapper">
    <?php echo $menuview; ?>
    <div id="page-wrapper">
        <div class="row" id="waring">
            <div class="col-lg-12">
                <h1 class="page-header">系统通知管理</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">

                    <div class="panel-heading">

                        <div class="form-group form-group-sm">
                            <button class="btn btn-primary" name="add">新增</button>
                        </div>

                    </div>

                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table" id="dataTables">
                            </table>
                        </div>
                        <!-- /.table-responsive -->

                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
    $(document).ready(function () {
        $('#dataTables').dataTable({
            "ajax": "<?=APP_ADMIN_PATH?>/msg/noticelist",
            "bDestroy": true,
            "columns": [
                {title: "消息ID", "data": "mid"},
                {title: "内容", "data": "body"},
                {title: "发送时间", "data": "ctime"}
             ],
            "aoColumnDefs": [
                {
                    sDefaultContent: '',
                    aTargets: ['_all']
                }
            ],

            "sDom": '<"top">rt<"bottom"p><"clear">',
            "iDisplayLength": 10,
            "bScrollCollapse": true,
            'ordering': false
        });

        //新增
        $(document).on("click", "button[name='add']", function () {
            document.location.href = "<?=APP_ADMIN_PATH?>/msg/noticeedit";
        });
    });
</script>
<style>
    table.table > tbody > tr > td {
        text-align: center;
        vertical-align: middle;
    }

    .thump {
        width: 30px;
        height: 30px;
        padding: 1px;
        background-color: #FFF;
        border: 1px solid #DDD;
        border-radius: 2px;
        transition: all 0.2s ease-in-out 0s;
    }
</style>

</body>

</html>
